<template>
  <div class="thumb">
    <div class="item-num" v-if="id">{{id}}</div>
    <div class="ItemCol-img-box">
      <a :href="data.mhref">
        <ImgLazy :url="require('@/assets/images/home/'+data.imgsrc)"/>
      </a>
        <PlayButton :duration="1000" :width="'40px'" :height="'40px'"></PlayButton>
    </div>
    <div class="item-info">
      <p class="name">{{data.songname}}</p>
      <p class="singer">{{data.singer}}</p>
      <p class="duration" v-if="isduration">{{data.duration}}</p>
    </div>
    <div class="action">
      <a href="javascript:;">
        <i class="iconfont icon-aixin"></i>
      </a>
      <a href="javascript:;">
        <i class="iconfont icon-fenxiang"></i>
      </a>
      <a href="javascript:;">
        <i class="iconfont icon-lingdang"></i>
      </a>
    </div>
  </div>
</template>

<script>
export default {
    name: "Item",
    props: {
        data:Object,
        isduration:Boolean,
        id:Number,
    },
}
</script>

<style lang="scss" scoped>
.thumb {
  height: inherit;
  padding: 0 70px 0 95px;
  border-radius: 8px;
  &:hover {
    background-color: rgba(0, 0, 0, 0.05);
    .ItemCol-img-box {
      img {
        transform: scale(1.1);
      }
    }
    .item-info {
      margin-right: 75px !important;
    }
    .duration {
      display: none;
    }
    .action {
      display: block;
    }
  }

  .ItemCol-img-box {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    cursor: pointer;

    img {
      transition: transform 0.5s;
    }

    .play {
      display: block;
    }
  }
  .item-info {
    width: auto;
    line-height: 30px;
    p {
      line-height: 30px;
    }
    .name {
      padding-top: 10px;
      cursor: pointer;
      &:hover {
        color: $ThemeColor;
      }
    }
    .singer {
      color: rgba(51, 51, 51, 0.4);
      cursor: pointer;
      &:hover {
        color: $ThemeColor;
      }
    }
    .duration {
      position: absolute;
      top: 0;
      right: 25px;
      line-height: 80px;
      color: rgba(51, 51, 51, 0.4);
    }
  }

  .action {
    position: absolute;
    right: 7px;
    top: 20px;
    display: none;

    a {
      display: block;
      float: left;
      margin-right: 4px;
      width: 40px;
      height: 40px;
      text-align: center;
      line-height: 40px;
      border-radius: 50%;
      font-weight: bolder;

      &:hover {
        color: $ThemeColor;
        background-color: #dbdbdb;
      }
    }
  }
}
</style>